<?php
// <editor-fold defaultstate="collapsed" desc="init">
set_include_path('C:\xampp\htdocs\ccivenezuela\includes');
require_once '../includes/inmueble.php';
$inmueble = new inmueble();
if (isset($_GET['id'])) {
    $registro = $inmueble->ver($_GET['id']);
}
// </editor-fold>
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>CCIVenezuela :: Ver inmueble </title>
        <script type="text/javascript" language="javascript" src="../js/jquery-1.4.2.min.js"></script>
        <script type="text/javascript" language="javascript" src="../js/jquery.cycle.all.pack.js"></script>
        <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/themes/cupertino/jquery-ui.css" rel="stylesheet" media="screen" type="text/css"/>
        <link href="../css/style.css" media="all" rel="stylesheet" type="text/css"/>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js"></script>
        <script type="text/javascript">
            var _gaq = _gaq || [];
            _gaq.push(['_setAccount', 'UA-571063-15']);
            _gaq.push(['_trackPageview']);
            (function() {
                var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
                ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
            })();
        </script>
        <script type="text/javascript" language="javascript">
            $(document).ready(function(){
                $(".cycle").cycle({
                    height:300,
                    fit:1,
                    slideExpr:"img",
                    prev:'#prev',
                    next:'#next'
                });
                $('.accordion').accordion();
            });
        </script>
        <style media="all" type="text/css">
            body{
                margin: 0;
                padding: 0;
                font-family: sans-serif;
                font-size: 12px;
                width: auto;
            }          
            h2{
                color:#01557A;
                margin:5px;
                text-shadow: 1px 1px 1px rgba(20,20,20,0.2);
            }
            .rojo{
                color:red;
            }

        </style>
    </head>
    <body>
        <?php if (isset($registro) && $registro['inmueble']['suceed'] && sizeof($registro['inmueble']['data']) > 0): ?>
            <div>
                <!-- Fotos -->
                <div class="cycle">
                    <a href="#nogo" id="prev">&laquo;</a>
                    <?php foreach ($registro['imagenes']['data'] as $imagen): ?>
                    <img alt="<?php echo $imagen['titulo']; ?>" height="315" width="420" src="<?php echo ROOT . IMAGES_INMUEBLES . $imagen['url']; ?>"/>
                    <?php endforeach; ?>
                    <a href="#nogo" id="next">&raquo;</a>
                </div>
                <?php foreach ($registro['inmueble']['data'] as $data): ?>
                    <div class="accordion">
                        <h3><a href="#">Datos del Inmueble</a></h3>
                        <div>
                            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td width="50%"><b>Habitaciones:</b></td>
                                    <td width="50%">&nbsp;</td>
                                </tr>
                                <tr>
                                    <td><?php echo $data['habitaciones']; ?></td>
                                    <td>&nbsp;</td>
                                </tr>
                                <tr>
                                    <td><b>Metros Cuadrados</b></td>
                                    <td><b>Ba&ntilde;os</b></td>
                                </tr>
                                <tr>
                                    <td><?php echo $data['mt2']; ?> mt<sup>2</sup></td>
                                    <td><?php echo $data['banios']; ?></td>
                                </tr>
                                <tr>
                                    <td><b>Tipo</b></td>
                                    <td><b>Antiguedad</b></td>
                                </tr>
                                <tr>
                                    <td><?php echo $data['tipo']; ?></td>
                                    <td><?php echo $data['antiguedad']; ?> A&ntilde;os</td>
                                </tr>
                                <tr>
                                    <td colspan="2"><b>Ubicación:</b></td>
                                </tr>
                                <tr>
                                    <td colspan="2"><p><?php echo $data['ubicacion'] . ". " . $data['Ciudad'] . ", Estado " . $data['Estado']; ?></p></td>
                                </tr>
                                <tr>
                                    <td colspan="2"><b>Precio</b></td>
                                </tr>
                                <tr>
                                    <td colspan="2"><p align="center" class="rojo"><b><?php echo number_format($data['precio'], 0, ',', '.'); ?> Bsf.</b></p></td>
                                </tr>
                            </table>
                        </div>
                        <h3><a href="#">Datos del Corredor</a></h3>
                        <div>
                            <table width="100%" cellpadding="0" cellspacing="0" border="0">
                                <tr>
                                    <td colspan="2" align="center" rowspan="5" width="25%">
                                        <img hspace="3" style="border-radius:5px;" src="<?php echo ROOT . IMAGES_USUARIOS . $data['usuario_foto']; ?>" width="100"/>
                                    </td>
                                    <th>Corredor:</th>
                                    <td align="center"><a title="Haga click aqu&iacute; para ver m&aacute;s inmuebles cargados por <?php echo $data['usuario_nombre'] . " " . $data['usuario_apellido']; ?>" href="<?php echo ROOT.USUARIOS; ?>corredor.php?id=<?php echo $data['usuario_id']; ?>" target="_blank"><?php echo $data['usuario_nombre'] . " " . $data['usuario_apellido']; ?></a></td>
                                </tr>
                                <tr>
                                    <th>Tel&eacute;fonos:</th>
                                </tr>
                                <tr>
                                    <td colspan="2" align="right">☎ <?php echo $data['usuario_telefono']; ?></td>
                                </tr>
                                <tr>
                                    <td colspan="2" align="right">☎ <?php echo $data['usuario_telefono2']; ?></td>
                                </tr>
                                <tr>
                                    <th>Email:</th>
                                    <td><?php echo $data['usuario_email']; ?></td>
                                </tr>
                            </table>
                        </div>
                        <h3><a href="#">Caracter&iacute;sticas</a></h3>
                        <div>
                            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td width="40%">Sala Comedor</td>
                                    <td width="10%"><?php echo ($data['salacomedor'] == 1) ? "<span class='green'>&radic;</span> " : ""; ?></td>
                                    <td width="40%">Cocina Empotrada</td>
                                    <td width="10%"><?php echo ($data['cocinaempotrada'] == 1) ? "<span class='green'>&radic;</span> " : ""; ?></td>
                                </tr>
                                <tr>
                                    <td>Lavadero</td>
                                    <td><?php echo ($data['lavadero'] == 1) ? "<span class='green'>&radic;</span> " : ""; ?></td>
                                    <td>Estac. Techado</td>
                                    <td><?php echo ($data['estacionamientotechado'] == 1) ? "<span class='green'>&radic;</span> " : ""; ?></td>
                                </tr>
                                <tr>
                                    <td>Cer&aacute;mica</td>
                                    <td><?php echo ($data['ceramica'] == 1) ? "<span class='green'>&radic;</span> " : ""; ?></td>
                                    <td>Ba&ntilde;o Auxiliar</td>
                                    <td><?php echo ($data['banioauxiliar'] == 1) ? "<span class='green'>&radic;</span> " : ""; ?></td>
                                </tr>
                                <tr>
                                    <td>Maletero</td>
                                    <td><?php echo ($data['maletero'] == 1) ? "<span class='green'>&radic;</span> " : ""; ?></td>
                                    <td>Gas Directo</td>
                                    <td><?php echo ($data['gasdirecto'] == 1) ? "<span class='green'>&radic;</span> " : ""; ?></td>
                                </tr>
                                <tr>
                                    <td>Estudio</td>
                                    <td><?php echo ($data['estudio'] == 1) ? "<span class='green'>&radic;</span> " : ""; ?></td>
                                    <td>Kirchenette</td>
                                    <td><?php echo ($data['kirchenette'] == 1) ? "<span class='green'>&radic;</span> " : ""; ?></td>
                                </tr>
                                <tr>
                                    <td>Parque</td>
                                    <td><?php echo ($data['parque'] == 1) ? "<span class='green'>&radic;</span> " : ""; ?></td>
                                    <td>Ascensor</td>
                                    <td><?php echo ($data['ascensor'] == 1) ? "<span class='green'>&radic;</span> " : ""; ?></td>
                                </tr>
                                <tr>
                                    <td>Vigilancia</td>
                                    <td><?php echo ($data['vigilancia'] == 1) ? "<span class='green'>&radic;</span> " : ""; ?></td>
                                    <td>Sal&oacute;n de Fiestas</td>
                                    <td><?php echo ($data['salonfiestas'] == 1) ? "<span class='green'>&radic;</span> " : ""; ?></td>
                                </tr>
                                <tr>
                                    <td>Calle Privada</td>
                                    <td><?php echo ($data['calleprivada'] == 1) ? "<span class='green'>&radic;</span> " : ""; ?></td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                </tr>
                            </table>
                        </div>
                        <h3><a href="#">Informaci&oacute;n Adicional</a></h3>
                        <div>
                            <table width="100%" cellpadding="0" cellspacing="0" border="0">
                                <tr>
                                    <th>Comentarios</th>
                                </tr>
                                <tr>
                                    <td>
                                        <p><?php echo $data['comentarios']; ?></p>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        
                    </div> 
                <?php endforeach; ?>
            </div>
        <?php else: ?>
            <div>
                <p>No se encontró el registro. Por favor intente de nuevo.</p>
            </div>
        <?php endif; ?>
    </body>
</html>
